package leecode

func reverseBookList(head *ListNode) []int {
	result := make([]int, 0)
	for head != nil {
		result = append(result, head.Val)
		head = head.Next
	}
	for i, j := 0, len(result)-1; i <= j; i, j = i+1, j-1 {
		result[i], result[j] = result[j], result[i]
	}
	return result
}
